package com.jss.lanouhn.fristapp.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.ImageView;

import com.jss.lanouhn.fristapp.R;

/**
 * 启动页面
 * Created by lanouhn on 16/8/24.
 */
public class SplashActivity extends AppCompatActivity{

    private ImageView iv_splash;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);

        iv_splash= (ImageView) findViewById(R.id.iv_splash);
        AlphaAnimation aa=new AlphaAnimation(0.6f,1.0f);
        aa.setDuration(1000*2);
        aa.setFillAfter(true);
        aa.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                startActivity(new Intent(SplashActivity.this,MainActivity.class));
                finish();
            }

            @Override
            public void onAnimationRepeat(Animation animation) {


            }

        });
        iv_splash.startAnimation(aa);
    }
}
